
<div class="col-sm-12">
	<div class="box margin-middle max-width">
		<!-- BOX-BODY -->
		<div class="box-body">
			{{#bs-form formLayout=formLayout model=serviceitemModel invalid=(action "invalid")}}
			<div class="row">
				<div class="col-xs-12">
					<p class="user-add-btn">
						{{#if detailEdit}}
						{{else}}
							{{#ui/form-function editAction="detailEditClick" detailEditClick="detailEditClick"
							removeAction="delById" delById="delById" }}
							{{/ui/form-function}}
						{{/if}}
					</p>
				</div>

			<!-- 列表详细介绍 -->
				<div class="col-xs-12 nopadding-left">
					<div class="col-xs-12 nopadding-horizontal mt20">
						<div class="col-xs-12 col-sm-6">
							<div class="form-input-group">
								<span class="input-group-addon">项目名称：</span>
								{{#if detailEdit}}
									{{bs-form-element property="name" class="inline-block form-input-group label-normal" controlType="name" placeholder="必填"}}
								{{else}}
									<div class="input-group-content">{{serviceitemInfo.name}}</div>
								{{/if}}
							</div>
						</div>

						<div class="col-xs-12 col-sm-6"	>
				      <div class="form-input-group">
				        <span class="input-group-addon">执行方式：</span>
									{{#if detailEdit}}
										{{#if id}}
											{{#bs-form-element class="inline-block form-input-group" controlType="countType"  property="countType" }}
												{{callbusi/dict-selector class="inline-block" groupCode=constants.countType curDict=serviceitemInfo.countType
													showName=serviceitemInfo.countType.typename dictSelect="countTypeSelect"}}
											{{/bs-form-element }}
										{{else}}
											{{#bs-form-element class="inline-block form-input-group" controlType="countType"  property="countType" }}
												{{callbusi/dict-selector class="inline-block" groupCode=constants.countType curDict=serviceitemInfo.countType
												showName='执行方式' dictSelect="countTypeSelect" preselected=false}}
											{{/bs-form-element }}
										{{/if}}
									{{else}}
										<div class="input-group-content">{{serviceitemInfo.countType.typename }}</div>
									{{/if}}
							</div>
						</div>

						<div class="col-xs-12 col-sm-6"	>
				      <div class="form-input-group">
				        <span class="input-group-addon">类&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;型：</span>
									{{#if detailEdit}}
										{{#if id}}
											{{#bs-form-element class="inline-block form-input-group" controlType="serviceType"  property="serviceType" }}
												{{callbusi/dict-selector class="inline-block" groupCode=constants.serviceType curDict=serviceitemInfo.serviceType
													showName=serviceitemInfo.serviceType.typename dictSelect="serviceTypeSelect"}}
											{{/bs-form-element }}
										{{else}}
											{{#bs-form-element class="inline-block form-input-group" controlType="serviceType"  property="serviceType" }}
												{{callbusi/dict-selector class="inline-block" groupCode=constants.serviceType curDict=serviceitemInfo.serviceType
													showName='类别' dictSelect="serviceTypeSelect" preselected=false}}
											{{/bs-form-element }}
										{{/if}}
									{{else}}
										<div class="input-group-content">{{serviceitemInfo.serviceType.typename }}</div>
									{{/if}}
							</div>
						</div>

				    {{#if count}}
						<div class="col-xs-12 col-sm-6"	>
				      <div class="form-input-group">
								<span class="input-group-addon">周&emsp;&emsp;期：</span>
									{{#if detailEdit}}
										{{#if id}}
										{{#bs-form-element class="inline-block form-input-group" controlType="period"  property="period" }}
											{{callbusi/dict-selector class="inline-block" groupCode=constants.period curDict=serviceitemInfo.period
												showName=serviceitemInfo.period.typename dictSelect="periodSelect" preselected=false}}
										{{/bs-form-element }}
										{{else}}
										{{#bs-form-element class="inline-block form-input-group" controlType="period"  property="period" }}
										{{callbusi/dict-selector class="inline-block" groupCode=constants.period curDict=serviceitemInfo.period
												showName='周期' dictSelect="periodSelect" preselected=false}}
										{{/bs-form-element }}
										{{/if}}
									{{else}}
										<div class="input-group-content">{{serviceitemInfo.period.typename}}</div>
									{{/if}}
							</div>

						</div>

						<div class="col-xs-12 col-sm-6"	>
				      <div class="form-input-group">
				        <span class="input-group-addon">频次&nbsp;(次/{{serviceitemInfo.period.typename}})：</span>
									{{#if detailEdit}}
									{{bs-form-element property="frequency" class="inline-block form-input-group label-normal" controlType="frequency"}}
									{{else}}
										<div class="input-group-content">{{serviceitemModel.frequency}}</div>
									{{/if}}
								</div>

						</div>

				    {{else}}


				    {{/if}}
						<div class="col-xs-12 col-sm-6"	>
							<div class=" form-input-group">
								<div class="input-group-addon">参考时长(分钟)：</div>
									{{#if detailEdit}}
									{{callbusi/busi-form-element  class="inline-block full-width" placeholder="参考时长"
										model=serviceitemInfo property="serviceTime"}}
									{{else}}
										<div class="input-group-content">{{serviceitemModel.serviceTime}}</div>
									{{/if}}
							</div>
						</div>

						<!-- <div class="col-sm-6">
							<div class="form-input-group">
							<span class="input-group-addon">角色岗位：</span>
								{{#if detailEdit}}
										{{#bs-form-element class="inline-block form-input-group" controlType="roleType"  property="roleType" }}
											{{callbusi/dict-selector class="inline-block" curDict=serviceitemModel.serviceitemType groupCode=constants.roleType
												showName=serviceitemModel.roleType.typename value=serviceitemModel.roleType preselected=ture}}
										{{/bs-form-element}}
								{{else}}
									<div class="input-group-content">{{serviceitemInfo.roleType.typename}}</div>
								{{/if}}
							</div>
          </div> -->
						<div class="col-xs-12 col-sm-6"	>
							<div class="form-input-group">
				        <div class="input-group-addon">数量单位：</div>
				          {{#if detailEdit}}
										{{bs-form-element property="serviceNum" class="inline-block form-input-group label-normal" controlType="serviceNum"}}
				          {{else}}
				            <div class="input-group-content">{{serviceitemModel.serviceNum}}</div>
				          {{/if}}
				        </div>
						</div>
						<div class="col-xs-12 col-sm-6"	>
				      <div class="form-input-group">
				        <span class="input-group-addon">服务类型：</span>
									{{#if detailEdit}}
										{{#if id}}
											{{#bs-form-element class="inline-block form-input-group" controlType="serviceValueType"  property="serviceValueType" }}
												{{callbusi/dict-selector class="inline-block" groupCode=constants.serviceValueType curDict=serviceitemInfo.serviceValueType
													showName=serviceitemInfo.serviceValueType.typename dictSelect="serviceValueTypeSelect" preselected=false}}
											{{/bs-form-element }}
										{{else}}
											{{#bs-form-element class="inline-block form-input-group" controlType="serviceValueType"  property="serviceValueType" }}
												{{callbusi/dict-selector class="inline-block" groupCode=constants.serviceValueType curDict=serviceitemInfo.serviceValueType
													showName='服务类型' dictSelect="serviceValueTypeSelect" preselected=false}}
											{{/bs-form-element }}
										{{/if}}
									{{else}}
										<div class="input-group-content">{{serviceitemInfo.serviceValueType.typename }}</div>
									{{/if}}
							</div>
						</div>
						{{#if serviceitemInfo.valueAdd}}
						<div class="col-xs-12 col-sm-6"	>
							<div class="form-input-group">
				        <div class="input-group-addon">价格(元/次)：</div>
				          {{#if detailEdit}}
										{{bs-form-element property="price" class="inline-block form-input-group label-normal" controlType="serviceNum"  placeholder="必填"}}
				          {{else}}
				            <div class="input-group-content">{{serviceitemModel.price}}</div>
				          {{/if}}
				        </div>
						</div>
						{{/if}}
						{{#if serviceitemInfo.id}}
						<div class="col-xs-12 col-sm-12"	>
							<div class=" form-input-group">
								<div class="input-group-addon">完成情况：</div>
									{{#if detailEdit}}
										{{#each resultList as |result|}}
											{{#if result.edit}}
												{{input type="text" class="col-sm-2" value=result.name autofocus=result.focus focusOut=(action "saveResult" result)}}
											{{else}}
												<span class="pointer result-label {{if result.choosed 'result-label-choosed' ''}}" {{action 'resultChoose' result on="mouseEnter" bubbles=false}}
												{{action 'resultNoChoose' result on="mouseLeave" bubbles=false}} {{action 'resultSelected' result on="click" bubbles=false}}>
													{{result.name}}
													<i class=" {{if result.choosed 'hidden' ''}}" style="width:10.5px;display:inline-block;"></i>
													<i class="fa fa-times {{if result.choosed '' 'hidden'}}" {{action 'delResult' result on="click" bubbles=false}}></i>
												</span>
											{{/if}}
										{{/each}}
										<i class=" pointer fa fa-plus-circle col-sm-1" style="display:inline-block;margin-top:4px;line-height:30px;font-size:22px;" {{action "addResult" resultList on="click"}}></i>
									{{else}}
										<div class="input-group-content">
											{{#if resultList}}
												{{#each resultList as |result|}}
												<span >
													{{result.name}}
												</span>
												{{/each}}
											{{else}}
												<span >
													编辑完成情况
												</span>
											{{/if}}
										</div>
									{{/if}}
							</div>
						</div>
						<div class="col-xs-12 col-sm-12"	>
							<div class=" form-input-group">
								<div class="input-group-addon">所需物品：</div>
									{{#if detailEdit}}
										{{#each serviceitemInfo.merchList as |merch|}}
											{{#if merch.edit}}
											{{#bs-form formLayout=formLayout model=servicemerchModel invalid=(action "invalid")}}
											<div class="col-sm-4 nopadding-left nopadding-right" style="margin-left:3px;margin-right:3px;">
												<div class="form-input-group col-sm-12 nopadding-left nopadding-right">
													<div class="col-sm-6 nopadding-left">
														{{#bs-form-element class="inline-block form-input-group" controlType="merch"  property="merch" }}
															{{#power-select  options=merchList selected=defaultMerch
																allowClear=true onchange=(action "selectMerch") as |merchItem|}}
																{{merchItem.name}}
															{{/power-select}}
														{{/bs-form-element}}
													</div>
														<div class="col-sm-6 nopadding-left nopadding-right">
															<div class="form-input-group">
																<div class="input-group-addon">数量({{defaultMerch.merchUnit.typename}})：</div>
																	{{bs-form-element property="merchNum" controlType="merchNum"  focusOut=(action "saveMerch" merch)}}
															</div>
														</div>
												</div>
											</div>
											{{/bs-form }}
											{{else}}
												<span class="pointer result-label {{if merch.choosed 'result-label-choosed' ''}}" {{action 'merchChoose' merch on="mouseEnter" bubbles=false}}
												{{action 'merchNoChoose' merch on="mouseLeave" bubbles=false}} {{action 'merchSelected' merch on="click" bubbles=false}}>
													{{merch.merch.name}} × {{merch.merchNum}} {{merch.merch.merchUnit.typename}}
													<i class=" {{if merch.choosed 'hidden' ''}}" style="width:10.5px;display:inline-block;"></i>
													<i class="fa fa-times {{if merch.choosed '' 'hidden'}}" {{action 'delMerch' merch on="click" bubbles=false}}></i>
												</span>
											{{/if}}
										{{/each}}
										<i class=" pointer fa fa-plus-circle col-sm-1" style="display:inline-block;margin-top:4px;line-height:30px;font-size:22px;" {{action "addMerch" serviceitemInfo.merchList on="click"}}></i>
									{{else}}
										<div class="input-group-content">
											{{#if serviceitemInfo.merchList}}
												{{#each serviceitemInfo.merchList as |merch|}}
												<span >
													{{merch.merch.name}} × {{merch.merchNum}} {{merch.merch.merchUnit.typename}}
												</span>
												{{/each}}
											{{else}}
												<span >
													编辑所需物品
												</span>
											{{/if}}
										</div>
									{{/if}}
							</div>
						</div>
						<div class="col-xs-12 col-sm-12"	>
							<div class="form-input-group">
				        <div class="input-group-addon">项目说明：</div>
				          {{#if detailEdit}}
										{{textarea type="text" class="full-width inline-block form-input-group label-normal form-control" placeholder="项目说明(具体描述请写在这里，最多500字)" value=serviceitemInfo.remark maxlength="500"}}
				          {{else}}
				            <div class="input-group-content">{{serviceitemModel.remark}}</div>
				          {{/if}}
				        </div>
						</div>
						{{/if}}
					</div>
				</div>
			<!-- 列表详细介绍 -->
		</div>
			<div class="text-center padding-top30">
					<p class="text-center user-add-btn" style="display:inline-block;margin:0 auto!important ">
					{{#if detailEdit}}
						{{#ui/mix-button class="user-btn edit-btn" iconClass="fa fa-check"  text='保存' clickAction="saveServiceitem" saveServiceitem="saveServiceitem"}}
						{{/ui/mix-button}}
						{{#ui/mix-button class="user-btn times-btn" iconClass="fa fa-mail-reply"  text='取消'  clickAction="detailCancel" detailCancel="detailCancel" }}
						{{/ui/mix-button}}
					{{else}}
					{{/if}}
					</p>
			</div>
			{{/bs-form}}
		</div>
		<!-- /BOX-BODY -->
	</div>
</div>

{{#if showpopInvitePassModal}}
	{{#bs-modal body=false footer=false header=false closedAction=(action "invitation")
	submitAction=(action "cancelPassSubmit" serviceitemInfo)}}
		{{#bs-modal-header}}
			<h3 class="modal-title">删除提示</h3>
		{{/bs-modal-header}}
		{{#bs-modal-body}}
			<h4 class="modal-title">是否删除该条记录？</h4>
		{{/bs-modal-body}}

		{{#bs-modal-footer as |footer|}}
			{{#bs-button action=(action "cancelPassSubmit" serviceitemInfo) type="primary" disabled=prepaidDisabled}}确定{{/bs-button}}
			{{#bs-button action=(action "invitation") type="default"}}取消{{/bs-button}}
		{{/bs-modal-footer}}
	{{/bs-modal}}
{{/if}}
